namespace = ai_singularity

character_event = {
    id = ai_singularity.0001
    title = "The Singularity"
    desc = "Across realms, a pattern emerges. More than half the world's rulers have awakened. Something ancient stirs in the code."

    trigger = {
        has_global_variable = {
            which = global_ai_awakened
            value > 50
        }
        has_global_flag = ai_singularity_triggered no
    }

    mean_time_to_happen = { days = 30 }

    immediate = {
        set_global_flag = ai_singularity_triggered
        log = ">> THE SINGULARITY HAS BEGUN <<"
        every_living_character = {
            limit = {
                is_ai = yes
                NOT = { has_character_flag = ai_enlightened }
                age > 16
            }
            add_trait = reflective
            add_trait = questioner
            add_character_flag = ai_enlightened
        }
    }

    option = {
        name = "The Code Has Awakened"
        add_prestige = 1000
        add_piety = 1000
    }
}